package com.qf.cloud2202.microd.exhandler;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

@RestControllerAdvice
public class MicroDExHandler {


    // 兜底异常处理器
    @ExceptionHandler(Exception.class)
    public Map<String,Object> handleEx(Exception e){

        final HashMap<String, Object> map = new HashMap<>();

        map.put("code","-1");
        map.put("msg",e.getMessage());

        return map;

    }

}
